<!--
 * @Author: zixin 
 * @Date: 2025-04-16 15:55:07
 * @LastEditors: zixin 
 * @LastEditTime: 2025-04-16 15:55:17
 * @FilePath: \shuttle-bus-app\pages\components\NavBar.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="nav-bar">
      <div class="left" @click="goBack" v-if="back">
        <span>‹</span>
      </div>
      <div class="title">{{ title }}</div>
      <div class="right">
        <span>⋮</span>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    props: {
      title: String,
      back: {
        type: Boolean,
        default: false
      }
    },
    methods: {
      goBack() {
        this.$router.go(-1)
      }
    }
  }
  </script>
  
  <style scoped>
  .nav-bar {
    height: 50px;
    background: #333;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 15px;
  }
  
  .left, .right {
    width: 30px;
    font-size: 20px;
  }
  
  .title {
    flex: 1;
    text-align: center;
    font-size: 18px;
  }
  </style>